package com.insurance.mapper;

import com.insurance.pojo.CouponsInfo;
import com.insurance.pojo.User;
import com.insurance.pojo.User1;
import com.insurance.pojo.User_coupon;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User1: 李辽
 * Date: 2020/10/27 17:09
 * Description:
 * Version: V1.0
 */
public interface CouponMapper {

    List<Map> queryCoupon(@Param("new_start_time") Date new_start_time, @Param("new_end_time")Date new_end_time, @Param("disbursement_id")Integer disbursement_id, @Param("usearea_id")Integer usearea_id);

    List<Map> qeuryDisbursement();

    List<Map> qeuryGetway();

    List<Map> qeuryUseArea();

    int editCoupon(CouponsInfo couponsInfo);

    int sendCoupon(User_coupon user_coupon);

    List<Map> queryTotalCoupon(User_coupon user_coupon);

    int updateTotalNumbler(@Param("user_coupon_id") int user_coupon_id, @Param("totalCounpon") int totalCounpon);

    List<Map> judgePhone(String user_phone);

    User1 queryUserId(@Param("user_phone") String user_phone);

    int addCoupon(CouponsInfo couponsInfo);


    //查询所有用户id
    List<Map> qeuryAllUserId();

    //将刚刚插入的优惠卷发送给所有普通用户
    int sendAllCouponToUser(@Param("coupon_id") int coupon_id, @Param("user_id") int user_id);
}
